package dao.impl;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;

import vo.Store;
import dao.AdminDao;
@Repository("adminDao")
public class AdminDaoImpl implements AdminDao{
	@PersistenceContext(name="un")
	private EntityManager em;

	@Override
	public List<Store> findStoreInfo() {
		String jpql="select s from store s";
		List<Store> ls = em.createQuery(jpql).getResultList();
		return ls;

	}


	@Override
	public void updateStoreStaute(String email) {


		String jpql = "update store a set a.admin_distribution=:distribution";

		em.createQuery(jpql).setParameter("distribution", true).executeUpdate();

		
	}
}
